<?php
$xtpl = new XTemplate("modules/home/default_stylesheet.htm");
//--
//--
//--
//--
$f_d = $rootPath."/bltemplates/layout/css/style.css";
//$f_dir = $rootPath."/ofst/main/";
//--
if($_POST[type] == 'EDIT'){
//	chmod($f_dir, octdec(777));
	$f_t = fopen($f_d,"w");
	$css_content = $_POST[content];
	fwrite($f_t,$css_content,strlen($css_content));
}elseif($_POST[type] == 'get_back'){
	$f_t = fopen($f_d,"w");
	$css_content = $DB->GetFieldValue('default_css', '1', 'content');
	fwrite($f_t,$css_content,strlen($css_content));
}
//--
$f_t = fopen($f_d,"r");
$css_content = fread($f_t,100000);
//--
$xtpl->assign("content",$css_content);
//--
//--
//--
//--
//--
//--
$waypathlink = '&raquo;&nbsp;<a href="#" class="waypath">Style Sheet Management</a>';
$xtpl_main->assign("waypathlink",$waypathlink);
//--
//--
//--
//--
//--
//--
$save_button = $GUI->button_ren("Save","javascript: doSaveCSS();");
$xtpl->assign("save_button",$save_button);
$get_back_button = $GUI->button_ren("Get Back","javascript: doGetBackDefaultCSS('get_back');");
$xtpl->assign("get_back_button",$get_back_button);
?>